<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__csd__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__csd.html">CSD          (CAPSENSE&amp;trade; Sigma Delta)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga22ab53f2e99efe2990b5c99c06dc0be7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga22ab53f2e99efe2990b5c99c06dc0be7">Cy_CSD_Init</a> (CSD_Type *base, <a class="el" href="structcy__stc__csd__config__t.html">cy_stc_csd_config_t</a> const *config, <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> key, <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:ga22ab53f2e99efe2990b5c99c06dc0be7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquires, locks, and configures the CSD HW block.  <a href="#ga22ab53f2e99efe2990b5c99c06dc0be7">More...</a><br /></td></tr>
<tr class="separator:ga22ab53f2e99efe2990b5c99c06dc0be7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72f4009cdd9b57d9edc9f9789d896b7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga72f4009cdd9b57d9edc9f9789d896b7c">Cy_CSD_DeInit</a> (const CSD_Type *base, <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> key, <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:ga72f4009cdd9b57d9edc9f9789d896b7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases the CSD HW block previously captured and locked by the caller.  <a href="#ga72f4009cdd9b57d9edc9f9789d896b7c">More...</a><br /></td></tr>
<tr class="separator:ga72f4009cdd9b57d9edc9f9789d896b7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga077bebfd76a1640f60ebdb0749afafe0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga077bebfd76a1640f60ebdb0749afafe0">Cy_CSD_Capture</a> (CSD_Type *base, <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> key, <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:ga077bebfd76a1640f60ebdb0749afafe0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquires and locks the CSD HW block without changing its configuration.  <a href="#ga077bebfd76a1640f60ebdb0749afafe0">More...</a><br /></td></tr>
<tr class="separator:ga077bebfd76a1640f60ebdb0749afafe0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaed0da3eeb7d2217581b1946ce102f0ae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#gaed0da3eeb7d2217581b1946ce102f0ae">Cy_CSD_Configure</a> (CSD_Type *base, const <a class="el" href="structcy__stc__csd__config__t.html">cy_stc_csd_config_t</a> *config, <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> key, const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:gaed0da3eeb7d2217581b1946ce102f0ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets configuration of all CSD HW block registers at once.  <a href="#gaed0da3eeb7d2217581b1946ce102f0ae">More...</a><br /></td></tr>
<tr class="separator:gaed0da3eeb7d2217581b1946ce102f0ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7685ad3c3b00b1c77bf67b03f944752f"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga7685ad3c3b00b1c77bf67b03f944752f">Cy_CSD_GetVrefTrim</a> (uint32_t referenceVoltage)</td></tr>
<tr class="memdesc:ga7685ad3c3b00b1c77bf67b03f944752f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adjusts the provided reference voltage based on factory trimmed SFLASH Vref trim registers.  <a href="#ga7685ad3c3b00b1c77bf67b03f944752f">More...</a><br /></td></tr>
<tr class="separator:ga7685ad3c3b00b1c77bf67b03f944752f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafc4c25c2faefdfb3f3fdcf070b645c13"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#gafc4c25c2faefdfb3f3fdcf070b645c13">Cy_CSD_GetLockStatus</a> (const CSD_Type *base, const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:gafc4c25c2faefdfb3f3fdcf070b645c13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies whether the specified CSD HW block is acquired and locked by a higher-level firmware.  <a href="#gafc4c25c2faefdfb3f3fdcf070b645c13">More...</a><br /></td></tr>
<tr class="separator:gafc4c25c2faefdfb3f3fdcf070b645c13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab3e991dec9a467c332da3f904bdf5acc"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#gab3e991dec9a467c332da3f904bdf5acc">Cy_CSD_GetConversionStatus</a> (const CSD_Type *base, const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *context)</td></tr>
<tr class="memdesc:gab3e991dec9a467c332da3f904bdf5acc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies whether the specified CSD HW block is busy (performing scan or conversion).  <a href="#gab3e991dec9a467c332da3f904bdf5acc">More...</a><br /></td></tr>
<tr class="separator:gab3e991dec9a467c332da3f904bdf5acc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga34f48f5162adea39ed451877893a1552"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga34f48f5162adea39ed451877893a1552">Cy_CSD_ReadReg</a> (const CSD_Type *base, uint32_t offset)</td></tr>
<tr class="memdesc:ga34f48f5162adea39ed451877893a1552"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads value from the specified the CSD HW block register.  <a href="#ga34f48f5162adea39ed451877893a1552">More...</a><br /></td></tr>
<tr class="separator:ga34f48f5162adea39ed451877893a1552"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3689a475c33996ff4cb5e8c24d1194c1"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga3689a475c33996ff4cb5e8c24d1194c1">Cy_CSD_WriteReg</a> (CSD_Type *base, uint32_t offset, uint32_t value)</td></tr>
<tr class="memdesc:ga3689a475c33996ff4cb5e8c24d1194c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a value to the specified CSD HW block register.  <a href="#ga3689a475c33996ff4cb5e8c24d1194c1">More...</a><br /></td></tr>
<tr class="separator:ga3689a475c33996ff4cb5e8c24d1194c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1cd332894daaff0869d0d3eaec40a811"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga1cd332894daaff0869d0d3eaec40a811">Cy_CSD_SetBits</a> (CSD_Type *base, uint32_t offset, uint32_t mask)</td></tr>
<tr class="memdesc:ga1cd332894daaff0869d0d3eaec40a811"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets bits, specified by the Mask parameter in the CSD HW block register, specified by the Offset parameter.  <a href="#ga1cd332894daaff0869d0d3eaec40a811">More...</a><br /></td></tr>
<tr class="separator:ga1cd332894daaff0869d0d3eaec40a811"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae0dba82a3024adfe048684f19979cf31"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#gae0dba82a3024adfe048684f19979cf31">Cy_CSD_ClrBits</a> (CSD_Type *base, uint32_t offset, uint32_t mask)</td></tr>
<tr class="memdesc:gae0dba82a3024adfe048684f19979cf31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears bits, specified by the Mask parameter in the CSD HW block register, specified by the Offset parameter.  <a href="#gae0dba82a3024adfe048684f19979cf31">More...</a><br /></td></tr>
<tr class="separator:gae0dba82a3024adfe048684f19979cf31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga86d12b64c2b1db82c94df03532d57ca6"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__csd__functions.html#ga86d12b64c2b1db82c94df03532d57ca6">Cy_CSD_WriteBits</a> (CSD_Type *base, uint32_t offset, uint32_t mask, uint32_t value)</td></tr>
<tr class="memdesc:ga86d12b64c2b1db82c94df03532d57ca6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes field, specified by the Mask parameter with the value, specified by the Value parameter.  <a href="#ga86d12b64c2b1db82c94df03532d57ca6">More...</a><br /></td></tr>
<tr class="separator:ga86d12b64c2b1db82c94df03532d57ca6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga22ab53f2e99efe2990b5c99c06dc0be7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga22ab53f2e99efe2990b5c99c06dc0be7">&#9670;&nbsp;</a></span>Cy_CSD_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> Cy_CSD_Init </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__csd__config__t.html">cy_stc_csd_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Acquires, locks, and configures the CSD HW block. </p>
<p>If the CSD HW block is already in use by other middleware or by the application program, the function returns the CY_CSD_LOCKED status and does not configure the CSD HW block.</p>
<p>If the acquisition is successful, this function writes configuration data into all CSD HW block registers (except read-only registers and SEQ_START register) at once. Because the SEQ_START register is excluded from write, use the <a class="el" href="group__group__csd__functions.html#ga3689a475c33996ff4cb5e8c24d1194c1" title="Writes a value to the specified CSD HW block register. ">Cy_CSD_WriteReg()</a> function to trigger the state machine for scan or conversion.</p>
<p>To capture the CSD block without its reconfiguration, use the <a class="el" href="group__group__csd__functions.html#ga077bebfd76a1640f60ebdb0749afafe0" title="Acquires and locks the CSD HW block without changing its configuration. ">Cy_CSD_Capture()</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to a configuration structure that contains the initial configuration.</td></tr>
    <tr><td class="paramname">key</td><td>The ID of middleware or a user-level function to work with the specified CSD HW block.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by the user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the operation result status (CSD status code). See <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga72f4009cdd9b57d9edc9f9789d896b7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72f4009cdd9b57d9edc9f9789d896b7c">&#9670;&nbsp;</a></span>Cy_CSD_DeInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> Cy_CSD_DeInit </td>
          <td>(</td>
          <td class="paramtype">const CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Releases the CSD HW block previously captured and locked by the caller. </p>
<p>If the CSD HW block is acquired by another caller or the block is in the busy state (performing scan or conversion), the de-initialization request is ignored and the corresponding status is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">key</td><td>The ID of middleware or a user-level function to work with the specified CSD HW block.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by the user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the operation result status (CSD status code). See <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga077bebfd76a1640f60ebdb0749afafe0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga077bebfd76a1640f60ebdb0749afafe0">&#9670;&nbsp;</a></span>Cy_CSD_Capture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> Cy_CSD_Capture </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Acquires and locks the CSD HW block without changing its configuration. </p>
<p>If the CSD HW block is already in use by other middleware or by the application program, the function returns the CY_CSD_LOCKED status.</p>
<dl class="section note"><dt>Note</dt><dd>This is a low-level function. Use the <a class="el" href="group__group__csd__functions.html#ga22ab53f2e99efe2990b5c99c06dc0be7" title="Acquires, locks, and configures the CSD HW block. ">Cy_CSD_Init()</a> function instead. The <a class="el" href="group__group__csd__functions.html#ga077bebfd76a1640f60ebdb0749afafe0" title="Acquires and locks the CSD HW block without changing its configuration. ">Cy_CSD_Capture()</a> function is used by upper-level middleware to improve efficiency. It also can be used to implement specific use cases. If this function is used, configure the CSD block using the <a class="el" href="group__group__csd__functions.html#gaed0da3eeb7d2217581b1946ce102f0ae" title="Sets configuration of all CSD HW block registers at once. ">Cy_CSD_Configure()</a> function.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">key</td><td>The ID of middleware or a user-level function to work with the specified CSD HW block.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by the user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the operation result status (CSD status code). See <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>. </dd></dl>

</div>
</div>
<a id="gaed0da3eeb7d2217581b1946ce102f0ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaed0da3eeb7d2217581b1946ce102f0ae">&#9670;&nbsp;</a></span>Cy_CSD_Configure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> Cy_CSD_Configure </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__csd__config__t.html">cy_stc_csd_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets configuration of all CSD HW block registers at once. </p>
<p>This function writes configuration data into all CSD block registers (except read-only registers and the SEQ_START register) at once. Because the SEQ_START register is excluded from write, use the <a class="el" href="group__group__csd__functions.html#ga3689a475c33996ff4cb5e8c24d1194c1" title="Writes a value to the specified CSD HW block register. ">Cy_CSD_WriteReg()</a> function to perform triggering state machine for scan or conversion.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>The pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">config</td><td>The pointer to a configuration structure that contains initial configuration.</td></tr>
    <tr><td class="paramname">key</td><td>The ID of middleware or a user-level function to work with the specified CSD HW block.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by the user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the operation result status (CSD status code). See <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga7685ad3c3b00b1c77bf67b03f944752f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7685ad3c3b00b1c77bf67b03f944752f">&#9670;&nbsp;</a></span>Cy_CSD_GetVrefTrim()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_CSD_GetVrefTrim </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>referenceVoltage</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adjusts the provided reference voltage based on factory trimmed SFLASH Vref trim registers. </p>
<p>This function is mainly used by CSDADC middleware only to get the most accurate reference voltage possible.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">referenceVoltage</td><td>The reference voltage to trim.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a trimmed reference voltage. </dd></dl>

</div>
</div>
<a id="gafc4c25c2faefdfb3f3fdcf070b645c13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafc4c25c2faefdfb3f3fdcf070b645c13">&#9670;&nbsp;</a></span>Cy_CSD_GetLockStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> Cy_CSD_GetLockStatus </td>
          <td>(</td>
          <td class="paramtype">const CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Verifies whether the specified CSD HW block is acquired and locked by a higher-level firmware. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by a user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a key code. See <a class="el" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line"></div><div class="line">    <a class="code" href="group__group__csd__enums.html#ga281a1b4a5cddb0bee365a7835985ccba">cy_en_csd_key_t</a> key;</div><div class="line"></div><div class="line">    key = <a class="code" href="group__group__csd__functions.html#gafc4c25c2faefdfb3f3fdcf070b645c13">Cy_CSD_GetLockStatus</a>(CSD0, &amp;csdContext);</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__csd__enums.html#gga281a1b4a5cddb0bee365a7835985ccbaa6ecb94eb2fc43363fdeb79fa9dd965b2">CY_CSD_NONE_KEY</a> == key)</div><div class="line">    {</div><div class="line">        <span class="comment">/* The CSD block is not captured */</span></div><div class="line">    }</div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="gab3e991dec9a467c332da3f904bdf5acc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab3e991dec9a467c332da3f904bdf5acc">&#9670;&nbsp;</a></span>Cy_CSD_GetConversionStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> Cy_CSD_GetConversionStatus </td>
          <td>(</td>
          <td class="paramtype">const CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__csd__context__t.html">cy_stc_csd_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Verifies whether the specified CSD HW block is busy (performing scan or conversion). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">context</td><td>The pointer to the context structure allocated by a user or middleware.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns status code. See <a class="el" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    </div><div class="line">    <a class="code" href="group__group__csd__enums.html#ga6cde526987c66fff895f48902589f979">cy_en_csd_status_t</a> status;</div><div class="line">    </div><div class="line">    status = <a class="code" href="group__group__csd__functions.html#gab3e991dec9a467c332da3f904bdf5acc">Cy_CSD_GetConversionStatus</a>(CSD0, &amp;csdContext);</div><div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group__group__csd__enums.html#gga6cde526987c66fff895f48902589f979a0899108469f2574d39e14fa3262aec11">CY_CSD_BUSY</a> == status)</div><div class="line">    {</div><div class="line">        <span class="comment">/* The CSD block is performing a conversion */</span></div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        <span class="comment">/* The CSD block is not busy and a new conversion could be started */</span></div><div class="line">    }</div><div class="line">    </div></div><!-- fragment -->
</div>
</div>
<a id="ga34f48f5162adea39ed451877893a1552"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34f48f5162adea39ed451877893a1552">&#9670;&nbsp;</a></span>Cy_CSD_ReadReg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_CSD_ReadReg </td>
          <td>(</td>
          <td class="paramtype">const CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads value from the specified the CSD HW block register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">offset</td><td>Register offset relative to base address.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a value of the CSD HW block register, specified by the offset parameter. </dd></dl>

</div>
</div>
<a id="ga3689a475c33996ff4cb5e8c24d1194c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3689a475c33996ff4cb5e8c24d1194c1">&#9670;&nbsp;</a></span>Cy_CSD_WriteReg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CSD_WriteReg </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes a value to the specified CSD HW block register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">offset</td><td>Register offset relative to base address.</td></tr>
    <tr><td class="paramname">value</td><td>Value to be written to the register. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1cd332894daaff0869d0d3eaec40a811"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1cd332894daaff0869d0d3eaec40a811">&#9670;&nbsp;</a></span>Cy_CSD_SetBits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CSD_SetBits </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets bits, specified by the Mask parameter in the CSD HW block register, specified by the Offset parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">offset</td><td>Register offset relative to base address.</td></tr>
    <tr><td class="paramname">mask</td><td>Mask value for register bits to be set. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gae0dba82a3024adfe048684f19979cf31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0dba82a3024adfe048684f19979cf31">&#9670;&nbsp;</a></span>Cy_CSD_ClrBits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CSD_ClrBits </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears bits, specified by the Mask parameter in the CSD HW block register, specified by the Offset parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">offset</td><td>Register offset relative to base address.</td></tr>
    <tr><td class="paramname">mask</td><td>Mask value for register bits to be cleared. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga86d12b64c2b1db82c94df03532d57ca6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga86d12b64c2b1db82c94df03532d57ca6">&#9670;&nbsp;</a></span>Cy_CSD_WriteBits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CSD_WriteBits </td>
          <td>(</td>
          <td class="paramtype">CSD_Type *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Writes field, specified by the Mask parameter with the value, specified by the Value parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to a CSD HW block base address.</td></tr>
    <tr><td class="paramname">offset</td><td>Register offset relative to base address.</td></tr>
    <tr><td class="paramname">mask</td><td>Specifies bits to be modified.</td></tr>
    <tr><td class="paramname">value</td><td>Specifies a value to be written to the register. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
